package MapRelated;

import java.util.ArrayList;
import java.util.List;

import android.graphics.drawable.Drawable;

import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.OverlayItem;



public class MyDeviceOverlay extends ItemizedOverlay<OverlayItem> {

	   private List<OverlayItem> _items = new ArrayList<OverlayItem>();

	    public MyDeviceOverlay(Drawable defaultMarker) 
	    {
	        super(boundCenterBottom(defaultMarker));        
	    }
	    

	    @Override
	    protected OverlayItem createItem(int i) 
	    {
	        return _items.get(i);
	    }

	    
	    public void addItem(OverlayItem overlay) 
	    {
	        _items.add(overlay);
	        populate();
	    }
	
	    //TODO
/*	    
	    public void addInvisiblePoint()
	    {
	    	_items.add(new OverlayItem());
	    }
*/	    

	    public void removeItem(OverlayItem overlay) 
	    {
	        _items.remove(overlay);
	        populate();
	    }


	    public void clear() 
	    {
	        _items.clear();
	        populate();
	    }
	    

	    @Override
	    public int size() 
	    {
	        return _items.size();
	    }
}
